﻿@{
    ViewBag.Title = "Index";
}
<script type="text/javascript">
    $(function () {
        $("#from01").submit(function () {
            return confirm('确认要提交数据吗?');
        });
        $("#btn").bind("click", function () {
            $("#id").submit(); 
        });
    });
    function aok(json) {
      
        alert(json.name);
    }
    function notOk() { }
    function abegin() { return confirm('b'); }

</script>
@using (Ajax.BeginForm("Index", "Form", new AjaxOptions { OnBegin = "abegin", OnSuccess = "aok", OnFailure = "notOk" ,HttpMethod="Post"}, new { id = "id" }))
{
    @Html.TextBox("name", 1)
    <input id="btn" type="button" value="button" />
}
